package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.AfterOrderFallBack;
import cn.cs.pojo.AfterOrder;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "cs-order-provider", configuration = CsConfiguration.class, fallback = AfterOrderFallBack.class)
public interface RestAfterOrderClient {

    @RequestMapping(value = "/getAfterOrderList", method = RequestMethod.POST)
    List<AfterOrder> getAfterOrderList(@RequestBody Map<String, Object> param);

    @RequestMapping(value = "/updateAfterOrder", method = RequestMethod.POST)
    int updateAfterOrder(@RequestBody AfterOrder order);


    @RequestMapping(value = "/getAfterOrderByUserIdAndOrderId", method = RequestMethod.POST)
    public List<Map<String, Object>> getAfterOrderByUserIdAndOrderId(@RequestParam("orderId") String orderId) throws Exception;

    @RequestMapping(value = "/getAfterOrderByUserId", method = RequestMethod.POST)
    public List<Map<String, Object>> getAfterOrderByUserId(@RequestParam("orderId") String orderId, @RequestParam("userId") String userId, @RequestParam("id") String id) throws Exception;

    @RequestMapping(value = "/addAfterOrder", method = RequestMethod.POST)
    public Integer addAfterOrder(@RequestBody AfterOrder afterOrder) throws Exception;

    @RequestMapping(value = "/modifyAfterOrder", method = RequestMethod.POST)
    public Integer modifyAfterOrder(@RequestBody AfterOrder afterOrder) throws Exception;

    @RequestMapping(value = "/getAfterOrderByOrderIdOne", method = RequestMethod.POST)
    public AfterOrder getAfterOrderByOrderIdOne(@RequestParam("orderId") String orderId) throws Exception;

    @RequestMapping(value = "/getAfterOrderCountByMap", method = RequestMethod.POST)
    public Integer getAfterOrderCountByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getAfterOrderListPage", method = RequestMethod.POST)
    public List<Map<String, Object>> getAfterOrderListPage(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getAfterOrderCountByMap", method = RequestMethod.POST)
    public Integer getAfterOrderAllCountByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getAfterOrderListPage", method = RequestMethod.POST)
    public List<Map<String, Object>> getAfterOrderAllListPage(@RequestBody Map<String, Object> param) throws Exception;



}
